execute unless entity @n[tag=temp.hitBox,distance=..10,type=giant] run return fail

scoreboard players set #maxHealth temp 1024
execute store result score #hitBoxHealth temp run data get entity @n[tag=temp.hitBox,distance=..10,type=giant] Health
scoreboard players operation #maxHealth temp -= #hitBoxHealth temp

execute store result storage vs:system temp.GT.value int 1 run scoreboard players get #maxHealth temp
function vs:system/game_ctrol/guard_tower/health/remove with storage vs:system temp.GT

playsound block.glass.break master @a ~ ~ ~ 1.3 1.0

scoreboard players reset #maxHealth temp
scoreboard players reset #hitBoxHealth temp
data modify entity @n[tag=temp.hitBox,distance=..10,type=giant] Health set value 1024.0f
data remove storage vs:system temp.GT
tag @n[tag=temp.hitBox,distance=..10,type=giant] remove temp.hitBox
